package com.wowo.aop.transaction;

public class StudentServiceImplProxy implements StudentService {
    StudentService studentService = new StudentServiceImpl();
    TransactionApsect transactionApsect = new TransactionApsect();
    @Override
    public void save() {
        transactionApsect.start();
        try {
            studentService.save();
        }catch (Exception e){
            transactionApsect.rollback();
        }
        transactionApsect.commit();
    }

    @Override
    public void update() {
        studentService.update();
    }

    @Override
    public void delete(int id) {
        studentService.delete(id);
    }
}
